﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Character_Creator
{
    public class Class
    {
        private string className;
        private string classReference;
        private uint classBaseAttackBonus;
        private uint classSkillRanksPerLevel;
        private List<Skill> classSkills;

        public string Name
        {
            get { return className; }
            private set { className = value; }
        }
        public string Reference
        {
            get { return classReference; }
            private set { classReference = value; }
        }
        public uint BaseAttackBonus
        {
            get { return classBaseAttackBonus; }
            private set { classBaseAttackBonus = value; }
        }
        public uint SkillRanksPerLevel
        {
            get { return classSkillRanksPerLevel; }
            private set { classSkillRanksPerLevel = value; }
        }
        public List<Skill> Skills
        {
            get { return classSkills; }
            private set { classSkills = value; }
        }

        /// <summary>
        /// Creates a character class from the Core Rulebook.
        /// </summary>
        /// <param name="name"> The name of the class. </param>
        /// <param name="reference"> The page reference of the class. </param>
        /// <param name="bab"> The base attack bonus of the class at level 1. </param>
        /// <param name="ranks"> The number of base skill ranks gained at each level of this class. </param>
        /// <param name="skills"> The skills the class favors. </param>
        public Class(string name, string reference, uint bab, uint ranks, List<Skill> skills)
        {
            SetClassName(name);
            SetClassPageReference(reference);
            SetClassBaseAttackBonus(bab);
            SetClassSkills(skills);
        }

        public void SetClassName(string name)
        {
            Name = name; 
        }
        public void SetClassPageReference(string reference)
        {
            Reference = reference; 
        }
        public void SetClassBaseAttackBonus(uint bab)
        {
            BaseAttackBonus = bab;
        }
        public void SetClassSkillRanksPerLevel(uint ranks)
        {
            SkillRanksPerLevel = ranks;
        }
        public void SetClassSkills(List<Skill> skills)
        {
            Skills = skills;
        }

        public override string ToString()
        {
            return Name;
        }
    }
}
